I had an issue with the Sharebar plugin today after I upgraded this blog to WordPress version 3.5. As always when making major WordPress upgrade on my blog I had made a backup of my files and database. This issue was not that big that my blog became inaccessible, but it was still annoying. I went for the Sharebar page at WordPress.org to look for an update to the plugin, but no luck 🙁 I decided to disable the plugin and started to look for others with the same problem. It was actually not that hard and I even found a couple of solutions/workaround to make it work without any errors on my blog.
The issue after upgrading to WordPress 3.5
After upgrading my blog I got this error on top of all my posts. The Sharebar actually looked like it was working, but I was not happy with these lines in top of all my posts:
Warning: Missing argument 2 for wpdb::prepare(), called in /var/www/techwork.dk/public_html/wp-content/plugins/sharebar/sharebar.php on line 112 and defined in/var/www/techwork.dk/public_html/wp-includes/wp-db.php on line 990
Warning: Missing argument 2 for wpdb::prepare(), called in /var/www/techwork.dk/public_html/wp-content/plugins/sharebar/sharebar.php on line 124 and defined in/var/www/techwork.dk/public_html/wp-includes/wp-db.php on line 990
The Fix to make ShareBar work with WordPress 3.5
If you know how to edit a PHP file in a text editor all you need is to edit the 2 lines creating this error in sharebar.php in your plugin folder. What I did was downloading the file via FTP to my PC to make sure that I had a copy if something went wrong. I then changed the 2 lines as stated below and uploaded it back to the sharbar plugin folder.
Line 112 looks something like this:
$results =$wpdb->get_results($wpdb->prepare(“SELECT * FROM “.$wpdb->prefix.”sharebar WHERE enabled=1 ORDER BY position, id ASC”)); $str .= “\n”;</a>
Correct line 112 to look like this instead:
$results =$wpdb->get_results($wpdb->prepare(“SELECT * FROM “.$wpdb->prefix.”sharebar WHERE enabled=1 ORDER BY position, id ASC”, null)); $str .= “\n”;
Line 124 looks something like this:
$results = $wpdb->get_results($wpdb->prepare(“SELECT * FROM “.$wpdb->prefix.”sharebar WHERE enabled=1 ORDER BY position, id ASC”)); $str .= “\n”;
Correct line 124 to loo like this instead:
$results = $wpdb->get_results($wpdb->prepare(“SELECT * FROM “.$wpdb->prefix.”sharebar WHERE enabled=1 ORDER BY position, id ASC”, null)); $str .= “\n”;
That should be all you need to do. It did the trick for this blog and I hope it can work for you too until the ShareBar gets an official update. I know a lot of people out there that are using the ShareBar plugin so I thought I would share this fix with you guys. I have heard that there should be other plugins out there with issues after the upgrade to WordPress 3.5. This is just another good reason to always keep your plugins as updated as possible.
You rock! Thank you soooo much.
Thank you Lisa. Glad I can help 🙂
Hi Thomas! Good for you on finding a fix for this. I’m sure this will help a ton of people who use this plugin.
I didn’t update WordPress yet, but I plan to do it this weekend. Hopefully all of my plugins will be working fine.
Thanks!
Hi Ileane
I was very happy to be able to fix this little issue, so I thought that other bloggers would be the same. Good luck with your upgrade. If just your plugins are up to date, I don’t think you will have any trouble with the upgrade.
I’ve been stalling on making the move to WordPress 3.5. Looks like I’ll stall a little longer. 😉 Thanks for finding and sharing the fix.
Hi Steve
Some times it is a good strategy to wait a bit before upgrading to the newest version, just to make sure that most of the bugs has been fixed already 🙂
i already upgrade to latest wordpress and so far don’t have any problem
Hi Juan
The Sharebar issue was the only issue I had with the upgrade.
Sharebar is one of the cripiest thing ever invented…. i really hate it.
Thanx for your help. working fine on my blog.
Thanks for the fix, worked perfectly!
Glad I could help Stacy 🙂
Worked a treat! Thanks. My blog at http://www.outdoorphotography.co.nz was broken after 3.5…..your tips helped it get back online!
Thanks for the info about the fix. Seems like the 3.5 update brought up a fair share of issues and problems, but thankfully all of them can be fixed with one tweak or another.
I’m starting to think that 3.5 has a bit lower quality than previous WordPress editions. I’m also hoping that there will be mini-updates or hotfixes on the way.
Hi Nadine
I am sure that the problems with the updates will be solved along the way. As long as it only is a problem with a plugin we can always disable it and keep the plugin running.
Nicely discovered Thomas, I know quite a few bloggers that will be loving the solution to the Share bar issue. I use Digg Digg for my sidebar, so thankfully I didn’t have an issue, though 9 times out of 10 something is bound to fail on a WordPress update 😉
Hi Karen 🙂
There often are issues when a new WordPress version is released, but I would say that most of the times it is due to bad plugins or themes.
Very true Thomas. a lot of themes don’t get updated ready for the new version of WordPress and do suffer from the lack of frequent updates 😉
This is always an issue with systems that use plugins. Newere core systems and older plugins may not get along so well initially.
3.5 is fine. It’s just that there are issues on release, as with every piece of software or a framework like WordPress.
Usually, “old” WordPress plugins work fine with newer framework versions, but it’s nice to see fixes like these when they don’t work.
Thanks for the info about the fix. Seems like the 3.5 update brought up a fair share of issues and problems, but thankfully all of them can be fixed with one tweak or another.
Cool stuff! Thanks for the fix. Hopefully ShareBar can release an official patch and then eventually learn from this so the plugin will still be compatible with future WordPress versions.
Hi Kris
So far there is no official patch for this issue. I really don’t know why. It should be pretty easy to fix for them I guess.
Thanks for sharing this fix Thomas, I’m a bit new at WordPress and was gutted to see the error messages on my posts. Hopefully there will be an update soon
Hi Alan
I hope they soon will get it fixed too.
I had the same troubles with Sharebar plugin.. Was dissapointed and stressed and gave up for a while. You literary saved me) Thanks for useful info!
Hi Evan
I am glad I good help you to get it fixed 🙂
Thanks a lot.. was facing problem as had upgraded to WordPress 3.5 recently.
Worked like a charm! Awesome fix just had this problem on client sites that had sharebar installed. Nice quick fix until they update the plugin. Thanks!
Thank you so much for this post! I started having troubles with this plugin after I updated several sites to 3.5
I finally just switched over to Addthis, even though I much prefer the Sharebar plugin. This will come in very handy!
I use wordpress and had same problem some time ago, and take lot of time to fix it. I should get here earlyer. But anyway now i know how to sove that, thanks
This was a great help. Thanks!!!
Just to let you know there is a new problem on the homapage of the blog after upgrading for 2.5 grr !!!
Can you help? It says it’s on line 195 for sharebar.php and also there is a problem with WP Super cache on line 90.
Thanks 🙂
Humm actually this is super weird. I have desactivated the plugin and then reactivate it and there is no error anymore… I am suspicious though…
Hi Lisa
I just noticed that the Sharebar plugin was just updated yesterday. Maybe you have upgraded to the new version? I just took a look on your blog and it looks like it is working again.
I know ! This is so weird. First time I upgraded it I got 3 errors and after desactivate and reactivate it, back again!
Anyway 🙂 Your tip did the trick wayyyy before the upgrade.
Wow, I’ve been looking for this for about a week! I’m completely new to wordpress and was having crazy trouble with plugins. Thanks for the help!
Thanks for making it easier to find it, nice blog!!
All other solutions were spinning my head round to fix this plug in but actually it was not that tough after reading this post.
BIG THANKS!
thanks for the clearance of Sharebar plugin will try it as i use now wordpress 4.0